import request from '@/utils/request'

// 获取结算跟踪列表
export function getSettlementTrackingList(params) {
  return request({
    url: '/crm/api/crmsettlementtracking/',
    method: 'get',
    params: params
  })
}

// 创建结算跟踪记录
export function createSettlementTracking(data) {
  return request({
    url: '/crm/api/crmsettlementtracking/',
    method: 'post',
    data: data
  })
}

// 更新结算跟踪记录
export function updateSettlementTracking(data) {
  return request({
    url: '/crm/api/crmsettlementtracking/',
    method: 'put',
    data: data
  })
}

// 删除结算跟踪记录
export function deleteSettlementTracking(id) {
  return request({
    url: '/crm/api/crmsettlementtracking/',
    method: 'delete',
    params: { id: id }
  })
}

// 从财务记录自动创建结算跟踪
export function autoCreateTrackingFromFinance() {
  return request({
    url: '/crm/api/crmsettlementtracking/auto_create/',
    method: 'post'
  })
}

// 获取PI类型生产单列表
export function getProductionOrdersPI(params) {
  return request({
    url: '/crm/api/crmsettlementtracking/production_orders_pi/',
    method: 'get',
    params: params
  })
}

// 获取物流询价列表
export function getShippingInquiries(params) {
  return request({
    url: '/crm/api/crmsettlementtracking/shipping_inquiries/',
    method: 'get',
    params: params
  })
}
